<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">        
        <title>訂購營地內容</title>        
        <style type="text/css">
            #ContentDiv{
                width:600px;
                margin-left: auto;
                margin-right: auto;
            }
            #CartTable{
                width:100%;
                border-collapse:collapse;
            }
            #CartTable thead{                
                font-weight: bold;
                background-color: #FFFFCC;
            }
            #CartTable td{
                padding:10px;
                border: black solid 1px;
            }
            .TableList{
                width:100%;
                border-collapse:collapse;                
            }
            .TableList td{
                padding:10px;
                width:25%;
                text-align: center
            }
        </style>
        <script type="text/javascript" src="/JavaCamping/scripts/jquery-1.11.1.min.js"></script>
        <script type="text/javascript">
            $(document).ready(function(){
                $("#ContinueBuyBtn").click(function(){
                    //history.back();
                    document.location="/JavaCamping/booking/calendar";
                });
                $("#ClearCartBtn").click(function(){
                    if(confirm("確定是否清空您的購物車？"))
                        document.location="/JavaCamping/booking/ClearCart";
                });
                $("#CheckOutBtn").click(function(){
                    if( confirm("結帳付款去"))   
                        document.location="/JavaCamping/booking/Checkinlodging";
                }); 
            });
        </script>
    </head>
    <body>
        <jsp:include page="../tools/TopBanner.jsp"></jsp:include>
        <h1>訂購營地內容</h1>
        <div id="ContentDiv">
        <form action="/JavaCamping/booking/UpdateCart" method="post">
        <table id="CartTable">
            <thead>
                <tr>
                    <td align="center">入住日期</td>
                    <td align="center">營地代碼</td>
                    <td align="center">營地名稱</td>
                    <td align="center">營地尺寸</td>
                    <td align="center">定價</td>
                    <td align="center">假別</td>
                    <td align="center">折扣</td>
                    <td align="center">小計</td>
                </tr>
            </thead>
            <c:forEach var="item" items="${Cart}">
                <tr>
                    <td align="center">${item["campDate"] }</td>
                    <td align="center">${item["id"]}</td>
                    <td align="center">${item["name"]}</td>
                     <td align="center">${item["campsize"]}</td>
                    <td align="center">${item["nprice"]}</td>
                    <td align="center">${item["holiday"]}</td>
                     <td align="center">${item["discounts"]}</td>
                      <td align="center">${item["price"]}</td>                 
                </tr>
            </c:forEach>
        </table> 
        <p>&nbsp;</p>
        <table class="TableList">
            <tr>
                <td style="text-align:right;font-weight:bold;"><b>商品小計：</b></td>
                <td>${total}</td>
                <td style="text-align:right;font-weight:bold;">總金額：</td>
                <td>${total}</td> 
            </tr>
        </table>
        <table class="TableList">
            <tr>
                <td><input type="button" id="ContinueBuyBtn" value="繼續購物" /></td>
                <td><input type="button" id="ClearCartBtn" value="清空購物車" /></td>
                <td><input type="button" id="CheckOutBtn" value="結帳去" /></td>
            </tr>            
        </table>
        </form>
        </div>
        <%@include file="../tools/PageFooter.jsp"  %>        
    </body>
</html>
